//
//  FPMovieViewController.m
//  FilmParadise
//
//  Created by lanou3g on 15/7/13.
//  Copyright (c) 2015年 DLYgroup. All rights reserved.
//

// -------->  却个小数组去获取视频信息,现在array里放到是所有的model

#import "FPMovieViewController.h"
#import "FPMovieTableViewCell.h"
#import "FPCruxTableViewCell.h"
#import "FPWillPlayTableViewCell.h"
#import "FPMovieHotPlayModel.h"
#import "FPHotPlayModel.h"
#import "FPWillPlayModel.h"
#import "FPPredictVidio.h"
#import "FPCruxCollectionViewCell.h"
#import "FPTrailerTableViewController.h"
#import "FPMovieDetailViewController.h"
#import "FPmainTopViewModel.h"
@interface FPMovieViewController ()<UITableViewDataSource,UITableViewDelegate,UIScrollViewDelegate,UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>

@property (nonatomic, strong) UIView *moveView;
@property (nonatomic, strong) UIView *hotingShowView;
@property (nonatomic, strong) UIView *willBeShowView;
@property (nonatomic, copy) NSString *filmNumber;
@property (nonatomic, copy) NSString *month;

@end

@implementation FPMovieViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // 创建scrollView(在上面添加tableView)
    [self B_scrollView];
    
    // 创建主视图
    [self B_mainView];
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    self.scrollView.frame = CGRectMake(0, kImageH(30), kScreenWidth, kScreenHeight - 94);
}
/*=========================================创建视图=============================================*/
#pragma mark - 创建视图
// 创建主视图(标题,scrollview,tableview)
- (void)B_mainView
{
    // 正在热映按钮
    self.titlebutton1 = [UIButton buttonWithType:UIButtonTypeSystem];
    self.titlebutton1.frame = CGRectMake(0, 0, kScreenWidth / 2, kImageH(32));
    self.titlebutton1.backgroundColor = [UIColor whiteColor];
    [self.titlebutton1 setTitle:@"正在热映" forState:UIControlStateNormal];
    [self.titlebutton1 setTitleColor:[UIColor colorWithRed:0.389 green:0.651 blue:1.000 alpha:1.000] forState:UIControlStateNormal];
    [self.titlebutton1 addTarget:self action:@selector(titleButton1Action) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_titlebutton1];
    
    // 即将上映按钮
    self.titlebutton2 = [UIButton buttonWithType:UIButtonTypeSystem];
    self.titlebutton2.backgroundColor = [UIColor whiteColor];

    self.titlebutton2.frame = CGRectMake(kScreenWidth / 2, 0, kScreenWidth / 2, kImageH(32));
    [self.titlebutton2 setTitle:@"即将上映" forState:UIControlStateNormal];
    [self.titlebutton2 setTitleColor:[UIColor colorWithRed:0.389 green:0.651 blue:1.000 alpha:1.000] forState:UIControlStateNormal];
    [self.titlebutton2 addTarget:self action:@selector(titleButton2Action) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_titlebutton2];
    
    // 切换视图时移动显示的view
    self.moveView = [[UIView alloc] initWithFrame:CGRectMake(0, kImageH(30), kScreenWidth / 2, 2)];
    self.moveView.backgroundColor = [UIColor colorWithRed:0.526 green:0.911 blue:1.000 alpha:1.000];
    [self.view addSubview:_moveView];
}

// 创建scrollView
- (void)B_scrollView
{
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, kImageH(30), kScreenWidth, kScreenHeight - 94)];
    self.scrollView.contentSize = CGSizeMake(kScreenWidth * 2, 0);
    self.scrollView.showsHorizontalScrollIndicator = NO;
    self.scrollView.bounces = NO;
    self.scrollView.delegate = self;
    self.scrollView.pagingEnabled = YES;
    [self.view addSubview:_scrollView];
    
    // 正在热映界面
    self.hotingShowView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - 36)];
    self.hotingShowView.backgroundColor = [UIColor whiteColor];
    [self.scrollView addSubview:_hotingShowView];
    
    // 创建tableView
    [self B_tableView];
    
    // 即将上映界面
    self.willBeShowView = [[UIView alloc] initWithFrame:CGRectMake(kScreenWidth, 0, kScreenWidth, kScreenHeight - 36)];
    self.willBeShowView.backgroundColor = [UIColor whiteColor];
    [self.scrollView addSubview:_willBeShowView];
    
    // 创建顶部视图
    [self B_topView];
    
    // 创建将要播放视图
    [self B_willPlayTableView];
}

// 创建tableView
- (void)B_tableView
{
    // 创建正在热映的tableView
    self.hotTableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0, kScreenWidth, kImageH(kScreenHeight - 64 - 30 - 45)) style:UITableViewStylePlain];
    self.hotTableView.backgroundColor = [UIColor whiteColor];
    self.hotTableView.delegate = self;
    self.hotTableView.dataSource = self;
    self.hotTableView.rowHeight = kImageH((kScreenHeight - 96) / 3.5);
    [self.hotingShowView addSubview:_hotTableView];
}

// 创建即将上映下面的tableView
- (void)B_willPlayTableView
{
    self.WillTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kImageH(kScreenHeight - 64 - 75)) style:UITableViewStylePlain];
    self.WillTableView.delegate = self;
    self.WillTableView.dataSource = self;
    self.WillTableView.tableHeaderView = [self B_topTitleLabel];
    self.WillTableView.rowHeight = kImageH(kImageH((kScreenHeight - 120) / 3 - 20));
    [self.willBeShowView addSubview:_WillTableView];
}
// 创建即将上映界面顶部tableView
- (void)B_topView
{
    self.topTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kImageH(180), kScreenWidth) style:UITableViewStylePlain];
    self.topTableView.delegate = self;
    self.topTableView.dataSource = self;
    self.topTableView.showsVerticalScrollIndicator = NO;
    self.topTableView.bounces = NO;
    self.topTableView.pagingEnabled = YES;
    [self.willBeShowView addSubview:_topTableView];
    
}

/*=========================================方法实现=============================================*/
#pragma mark - 方法实现
// titlebutton点击事件
- (void)titleButton1Action
{
    self.moveView.frame = CGRectMake(0, 31, kScreenWidth / 2, 2);
    _scrollView.contentOffset = CGPointMake(0, 0);
    NSLog(@"点击了正在热映");
}

- (void)titleButton2Action
{
    self.moveView.frame = CGRectMake(kScreenWidth / 2, 31, kScreenWidth / 2, 2);
    _scrollView.contentOffset = CGPointMake(kScreenWidth, 0);
    NSLog(@"点击了即将上映");
}

// 超额预售/上映提醒按钮
- (void)aheadShopButton:(UIButton *)button
{
    NSLog(@"点击了超前预售");
}

// 内容预告片按钮
- (void)trailerButton:(UIButton *)button
{
    FPTrailerTableViewController *fptrailerTC = [[FPTrailerTableViewController alloc] init];
    FPWillPlayTableViewCell *cell   = (FPWillPlayTableViewCell *)button.superview.superview;
    NSUInteger row = [self.WillTableView indexPathForCell:cell].row;
    
    FPWillPlayModel *model                   = _willPlayArray[row];
    fptrailerTC.videoArray  = model.videos;
    [self.navigationController pushViewController:fptrailerTC animated:YES];
}

// 最受关注预告片按钮
- (void)topTrailerButton:(UIButton *)button
{
    FPTrailerTableViewController *fptrailerTC = [[FPTrailerTableViewController alloc] init];
    FPCruxCollectionViewCell *collectCell = (FPCruxCollectionViewCell *)button.superview.superview;
    UICollectionView *collect = (UICollectionView *)button.superview.superview.superview;

    NSUInteger row = [collect indexPathForCell:collectCell].item;
    
    FPWillPlayModel *model                   = _willTopArray[row];
    fptrailerTC.videoArray  = model.videos;
    [self.navigationController pushViewController:fptrailerTC animated:YES];

}

/*=========================================tableView=============================================*/
#pragma mark - tableView基本设置
// 设置表头高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    if ([tableView isEqual:_WillTableView]) {
        if (section == 0) {
            return 0;
        }else{
        return kImageH(35);
        }
    }else{
        return 0;
    }
}

// 设置表尾高度
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    if ([tableView isEqual:_WillTableView]) {
        if (section == 0) {
            return kImageH(40);
        }else{
            return 0;
        }
    }else{
        return 0;
    }
}

// 每行的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([tableView isEqual:_WillTableView]) {
        if (indexPath.section == 0) {
            return kImageH(180);
        }else{
            return (kScreenHeight - 120) / 3 - 20;
        }
    }else{
        return (kScreenHeight - 96) / 3.5 - 10;
    }
}

// 每个分组有多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if ([tableView isEqual:_hotTableView]) {
        return _hotMovieArray.count;
    }
    if ([tableView isEqual:_WillTableView]) {
        if (section == 0) {
            return 1;
        }else{
            return _willPlayArray.count;
        }
    }else {
        return 7;
    }
}

// 有多少个分组
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    if ([tableView isEqual:_hotTableView]) {
        return 1;
    }
    if ([tableView isEqual:_WillTableView]) {
        return 2;
    }else{
        return 1;
    }
}


#pragma mark - 返回cell
// 返回cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if ([tableView isEqual:_hotTableView]) {
        static NSString *cellIdentifier = @"cell1";
        [tableView registerClass:[FPMovieTableViewCell class] forCellReuseIdentifier:cellIdentifier];
        FPMovieTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
     
        FPMovieHotPlayModel *movieModel = _hotMovieArray[indexPath.row];
        [cell adjustSubviewsWithContent:movieModel.titleCn];
        // -------------展示cell
        cell.titleLabel.text      = movieModel.titleCn;
        cell.contentLable.text    = [NSString stringWithFormat:@"“%@",movieModel.commonSpecial];
        cell.screenDateLabel.text = [NSString stringWithFormat:@"%ld月%ld日上映",movieModel.rMonth,movieModel.rDay];
        cell.markLabel.text       = [NSString stringWithFormat:@"%.1f",movieModel.ratingFinal];
        cell.cinemaNumLabel.text  = [NSString stringWithFormat:@"今日%d家影院  %d场",movieModel.nearestCinemaCount ,movieModel.nearestShowtimeCount];
        [cell.displyImageView sd_setImageWithURL:[NSURL URLWithString:movieModel.img] placeholderImage:[UIImage imageNamed:@"2.jpg"] completed:nil];
        movieModel.is3D ? (cell.thirdDLabel.hidden = NO) : (cell.thirdDLabel.hidden = YES);
        movieModel.isIMAX ? (cell.imaxLabel.hidden = NO) : (cell.imaxLabel.hidden = YES);
        movieModel.isDMAX ? (cell.chinaLabel.hidden = NO) : (cell.chinaLabel.hidden = YES);
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;
    }
    if ([tableView isEqual:_WillTableView]) {
        if (indexPath.section == 0) {
            static NSString * cellIdentifier = @"cell2";
            [tableView registerClass:[FPCruxTableViewCell class] forCellReuseIdentifier:cellIdentifier];
            FPCruxTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
            if (_willTopArray.count != 0) {
                cell.collectView.dataSource = self;
                cell.collectView.delegate = self;
            }
            
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            return cell;
        }else{
            
            static NSString * cellIdentifier  = @"cell3";
            [tableView registerClass:[FPWillPlayTableViewCell class] forCellReuseIdentifier:cellIdentifier];
            FPWillPlayTableViewCell * cell  = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
            
            FPWillPlayModel *model          = _willPlayArray[indexPath.row];
            cell.filmNameLabel.text         = model.title;
            cell.wantedCountLabel.text      = [NSString stringWithFormat:@"%ld",model.wantedCount];
            cell.typeLabel.text             = model.type;
            _month                          = [NSString stringWithFormat:@"%ld",model.rMonth];
            cell.dateLabel.text             = [NSString stringWithFormat:@"%2ld日",model.rDay];
            cell.directLabel.text           = [NSString stringWithFormat:@"%@",model.director];
            [cell.displayImageView sd_setImageWithURL:[NSURL URLWithString:model.image]
                                     placeholderImage:[UIImage imageNamed:@"2.jpg"] completed:nil];
            [cell.aheadShopButton addTarget:self action:@selector(aheadShopButton:) forControlEvents:UIControlEventTouchUpInside];
            [cell.trailerButton addTarget:self action:@selector(trailerButton:) forControlEvents:UIControlEventTouchUpInside];
            if (model.isTicket) {
                [cell.aheadShopButton setTitle:@"超前预售" forState:UIControlStateNormal];
                [cell.aheadShopButton setTintColor:[UIColor whiteColor]];
                cell.aheadShopButton.backgroundColor =[UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000];

                
            }else{
                [cell.aheadShopButton setTitle:@"上映提醒" forState:UIControlStateNormal];
                cell.aheadShopButton.backgroundColor = [UIColor whiteColor];
                [cell.aheadShopButton setTintColor:[UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000]];
            }
            
            cell.selectionStyle = UITableViewCellSelectionStyleNone;
            return cell;

        }
    }
    else{
        static NSString *cellIdentifier = @"cell4";
        UITableViewCell * cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellIdentifier];
        return cell;
    }
}

#pragma mark - 设置表头 / 表尾
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
    UIView * myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 30)];
    myView.backgroundColor = [UIColor whiteColor];
    
    UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(kImageH(15), kImageH(5), kImageH(50), kImageH(30))];
    label.font = [UIFont systemFontOfSize:14.0 weight:2.0];
    [myView addSubview:label];
    
    _month = @"07";
    section == 0 ? nil : (label.text = [NSString stringWithFormat:@"%@月",_month]);
    
    UIView * sepView = [[UIView alloc] initWithFrame:CGRectMake(kImageH(15), kImageH(35), kImageH(kScreenWidth - 15), kImageH(1))];
    sepView.backgroundColor = [UIColor colorWithWhite:0.792 alpha:1.000];
    [myView addSubview:sepView];
    
    return myView;
}

// 设置表尾
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
    

    UIView * myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kImageH(40))];
    myView.backgroundColor = [UIColor whiteColor];
    UIView * widthView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kImageH(10))];
    widthView.backgroundColor = [UIColor lightGrayColor];
    [myView addSubview:widthView];
    UILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(kImageW(15), kImageH(15), kImageW(200), kImageH(30))];
    label.font = [UIFont systemFontOfSize:19.0 weight:2.0];
    [myView addSubview:label];
    
    _filmNumber = [NSString stringWithFormat:@"%ld",_willPlayArray.count];
    section == 0 ? label.text = [NSString stringWithFormat:@"即将上映 (%@部)",_filmNumber] : nil;
    
    return myView;
}

// 创建顶部"轮播图"的tableView--->分组名
- (UIView *)B_topTitleLabel
{
    // 顶部标题
    UILabel * titleLabel = [UILabel labelWithFrame:CGRectMake(kImageH(15) ,kImageH(10), kImageH(150), kImageH(30)) text:@"  最受关注" fontSize:21.0 fontWeight:2.0 color:[UIColor blackColor]];
    titleLabel.backgroundColor = [UIColor colorWithWhite:0.939 alpha:1.000];
    return titleLabel;
}

// 点击cell触发方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    FPMovieDetailViewController *fpMovieDetailVC = [[FPMovieDetailViewController alloc] init];
    FPmainTopViewModel * model      = [[FPmainTopViewModel alloc] init];
     if ([tableView isEqual:_hotTableView]) {
            FPMovieHotPlayModel *movieModel = _hotMovieArray[indexPath.row];
            model.actor1                    = movieModel.actorName1;
            model.actor2                    = movieModel.actorName2;
            model.titleCn                   = movieModel.titleCn;
            model.titleEn                   = movieModel.titleEn;
            model.imgstr                    = movieModel.img;
            model.ratingFinal               = [NSString stringWithFormat:@"%f",movieModel.ratingFinal];
            model.directorName              = movieModel.directorName;
            model.rDay                      = [NSString stringWithFormat:@"%ld",movieModel.rDay];
            model.rMonth                    = [NSString stringWithFormat:@"%ld",movieModel.rMonth];
            model.rYear                     = [NSString stringWithFormat:@"%ld",movieModel.rYear];
            model.movieID                   = [NSString stringWithFormat:@"%ld",movieModel.movieId];
            fpMovieDetailVC.viewModel       = model;
     }
    if ([tableView isEqual:_WillTableView]) {
        FPWillPlayModel *willPlaymodel      = _willPlayArray[indexPath.row];
        model.actor1                    = willPlaymodel.actor1;
        model.actor2                    = willPlaymodel.actor2;
        model.titleCn                   = willPlaymodel.title;
//        model.titleEn                   = willPlaymodel.titleEn;
        model.imgstr                    = willPlaymodel.image;
//        model.ratingFinal               = [willPlaymodel stringWithFormat:@"%f",willPlaymodel.ratingFinal];
        model.directorName              = willPlaymodel.director;
        model.rDay                      = [NSString stringWithFormat:@"%ld",willPlaymodel.rDay];
        model.rMonth                    = [NSString stringWithFormat:@"%ld",willPlaymodel.rMonth];
        model.rYear                     = [NSString stringWithFormat:@"%ld",willPlaymodel.rYear];
        model.movieID                   = [NSString stringWithFormat:@"%ld",willPlaymodel.ID];
        fpMovieDetailVC.viewModel       = model;
    }
    [self.navigationController pushViewController:fpMovieDetailVC animated:NO];
}

#pragma mark - 滑动视图协议方法
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    
    if (_scrollView.contentOffset.x == kScreenWidth) {
        self.moveView.frame = CGRectMake(kScreenWidth / 2, 31, kScreenWidth / 2, 2);
    }
    if (_scrollView.contentOffset.x == 0) {
        self.moveView.frame = CGRectMake(0, 31, kScreenWidth / 2, 2);
    }
}

/*=========================================collectionView=============================================*/
#pragma mark - collectionView协议方法
// 返回cell的宽和高
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
    return CGSizeMake(kScreenWidth, kImageH(160));
}

// 一共多少个分组
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
    return 1;
}

// 每个分组多少个item
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return _willTopArray.count;
}

#pragma mark - 返回cell
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
      static NSString * cellIdentifier = @"collectionCell";
    [collectionView registerClass:[FPCruxCollectionViewCell class] forCellWithReuseIdentifier:cellIdentifier];
    FPCruxCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellIdentifier forIndexPath:indexPath];
    
    FPWillPlayModel *willPlayModel = _willTopArray[indexPath.row];
    cell.filmNameLabel.text     = willPlayModel.title;
    cell.typeLabel.text         = willPlayModel.type;
    cell.directLabel.text       = willPlayModel.director;
    cell.actorLabel.text        = [NSString stringWithFormat:@"%@、%@",willPlayModel.actor1,willPlayModel.actor2];
    cell.dateLabel.text         = [NSString stringWithFormat:@"%ld月%ld日",willPlayModel.rMonth,willPlayModel.rDay];
    cell.wantedCountLabel.text  = [NSString stringWithFormat:@"%ld",willPlayModel.wantedCount];
    [cell.displayImageView sd_setImageWithURL:[NSURL URLWithString:willPlayModel.image] placeholderImage:[UIImage imageNamed:@"please_tryagain"]];
    [cell.aheadShopButton addTarget:self action:@selector(aheadShopButton:) forControlEvents:UIControlEventTouchUpInside];
    [cell.trailerButton addTarget:self action:@selector(topTrailerButton:) forControlEvents:UIControlEventTouchUpInside];
    if (willPlayModel.isTicket) {
        [cell.aheadShopButton setTitle:@"超前预售" forState:UIControlStateNormal];
        [cell.aheadShopButton setTintColor:[UIColor whiteColor]];
        cell.aheadShopButton.backgroundColor =[UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000];
        
        
    }else{
        [cell.aheadShopButton setTitle:@"上映提醒" forState:UIControlStateNormal];
        cell.aheadShopButton.backgroundColor = [UIColor whiteColor];
        [cell.aheadShopButton setTintColor:[UIColor colorWithRed:0.000 green:0.688 blue:0.000 alpha:1.000]];
    }

    return cell;
}

// collection点击方法
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSLog(@"点击了最受关注表头");
    
    FPMovieDetailViewController *fpMovieDetailVC = [[FPMovieDetailViewController alloc] init];
    FPmainTopViewModel * model      = [[FPmainTopViewModel alloc] init];
    FPWillPlayModel *willPlayModel = _willTopArray[indexPath.row];
    model.actor1                    = willPlayModel.actor1;
    model.actor2                    = willPlayModel.actor2;
    model.titleCn                   = willPlayModel.title;
//    model.titleEn                   = willPlayModel.titleEn;
    model.imgstr                    = willPlayModel.image;
//    model.ratingFinal               = [NSString stringWithFormat:@"%f",willPlayModel.ratingFinal];
    model.directorName              = willPlayModel.director;
    model.rDay                      = [NSString stringWithFormat:@"%ld",willPlayModel.rDay];
    model.rMonth                    = [NSString stringWithFormat:@"%ld",willPlayModel.rMonth];
    model.rYear                     = [NSString stringWithFormat:@"%ld",willPlayModel.rYear];
    model.movieID                   = [NSString stringWithFormat:@"%ld",willPlayModel.ID];
    fpMovieDetailVC.viewModel       = model;

    [self.navigationController pushViewController:fpMovieDetailVC animated:NO];


}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
